UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WXLoB3D9TNSdGE9fkHoy5TvipF5jJV1ApvqJ/Ym8DUE=' 
WHERE 
  key_id = '8145b04e233a2263fb3164aa8e050573481ed2a4c26b857d845807d77ca4f429' 
  AND (
    token = 'WXLoB3D9TNSdGE9fkHoy5TvipF5jJV1ApvqJ/Ym8DUE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039