UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fvJMvWYZUE2AXfhIiPrAViLmnkQqWd5W2qM45gwj7RY=' 
WHERE 
  key_id = '32abcab6f1c2e4da0dbcdf59d0eb2ef20d79746d19e6cab6ab2ec666281b6766' 
  AND (
    token = 'fvJMvWYZUE2AXfhIiPrAViLmnkQqWd5W2qM45gwj7RY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030