UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e62l4KYtAPyGoQILLe8zVsRT3AtpB3DXEMiANrQDhJk=' 
WHERE 
  key_id = 'f0c73594706e377a4936715c03be350db4e1a313ced3b6418e8171f29a1ec25a' 
  AND (
    token = 'e62l4KYtAPyGoQILLe8zVsRT3AtpB3DXEMiANrQDhJk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051