UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b3wZEuKRoxYIgR5v9V6uyn7KguJjzOxkjL0bFAcU59w=' 
WHERE 
  key_id = '8a6524661f080240aa7ef566dd22f083821fdd3fd50fcfb275ac763da857ab66' 
  AND (
    token = 'b3wZEuKRoxYIgR5v9V6uyn7KguJjzOxkjL0bFAcU59w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033