UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yf+c0jkxpkNz7YqZrmnxlZdIsMU9KN7B6jojQR0Kejw=' 
WHERE 
  key_id = '4ce919e2f3f0b4378f1c0cfd4c6ce3f10e8983def84a5eae1eb7008ec8b8eff1' 
  AND (
    token = 'Yf+c0jkxpkNz7YqZrmnxlZdIsMU9KN7B6jojQR0Kejw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017