UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M+yJlM1n/7/utiqDgHurnr/TLnaoepc7qBdSPYDkWEU=' 
WHERE 
  key_id = '7d653ccf32f2ba9495cc60a24d8e321c61ec1d89c71ccc8d81644984a581b73f' 
  AND (
    token = 'M+yJlM1n/7/utiqDgHurnr/TLnaoepc7qBdSPYDkWEU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058