UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Yzlz5lyM34q4hK0zsFetTkX6SL5pySazcgHwDFAuQY=' 
WHERE 
  key_id = '005384ab94a856e92fc3efa627d756e1d4a26feba42c0edb787b85c9dc983a05' 
  AND (
    token = '1Yzlz5lyM34q4hK0zsFetTkX6SL5pySazcgHwDFAuQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00109