UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QPfeG1oIVRWFqn/bq3MEKRgVwXIpAApVvsrwbR8k5Ys=' 
WHERE 
  key_id = 'a48a14f14e23b1a4456979fdb970d4fcea5c64899781ba9702f547286f49448e' 
  AND (
    token = 'QPfeG1oIVRWFqn/bq3MEKRgVwXIpAApVvsrwbR8k5Ys=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020