UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cqkLX6Xy9fyRSyWZY7OzRTnv0dvZGBgxSjIXvfO0wV8=' 
WHERE 
  key_id = '0f4a520a2ffbfc803d38a505f017de59b7647b7ca0d51ebf604aaebaa1127c27' 
  AND (
    token = 'cqkLX6Xy9fyRSyWZY7OzRTnv0dvZGBgxSjIXvfO0wV8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027