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

Query time 0.00024