UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5HlOxJCwZEbyniczO4UfhzcbjleucrToTZqIA+RegwM=' 
WHERE 
  key_id = '84519db3c54c37e10abb06edaa7f6060eb4f0fb7be5d2c971f7d163b48db1b63' 
  AND (
    token = '5HlOxJCwZEbyniczO4UfhzcbjleucrToTZqIA+RegwM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00107