UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PVtcJmh5E20K8pbA/Rt0CZtfcOCZrDxA9VIhpPjunbQ=' 
WHERE 
  key_id = '9579d2f471144608a07348f7fce3f7abcba1b15ead85defef174508e2e90107b' 
  AND (
    token = 'PVtcJmh5E20K8pbA/Rt0CZtfcOCZrDxA9VIhpPjunbQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030