UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fb5FdZwYZq9m62KQ8HNAgKaFpBoL9v3KYKRGj/w/LGI=' 
WHERE 
  key_id = 'c9dfcbb08fcee963ce34115a9c8b42f9242307f396408f91f65f3b8416871beb' 
  AND (
    token = 'fb5FdZwYZq9m62KQ8HNAgKaFpBoL9v3KYKRGj/w/LGI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030