UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8BiMSElaJ8TE8hJN05Wx4EFfw96ahmn6J/iaCwcddbM=' 
WHERE 
  key_id = '281165b4b6094d883e5368a5c09d36e5785503998a4ad6b032cdd62fbc200e86' 
  AND (
    token = '8BiMSElaJ8TE8hJN05Wx4EFfw96ahmn6J/iaCwcddbM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021