UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LlUjhlUwarXF2I9htf91scelUw64BVYycajnglMC6T0=' 
WHERE 
  key_id = '7a486fdb43643591781d3741a96bc20b0cad22fc449085305a5830ccaec20169' 
  AND (
    token = 'LlUjhlUwarXF2I9htf91scelUw64BVYycajnglMC6T0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035