UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CgBvZC/QZr9/yz4MXbjQfYZ+T8r0AKOcJvP/VEAHB1g=' 
WHERE 
  key_id = 'eba1dbd697fa56f549996819dbb246b238613e7375cc1ab6ac1629e31410ac1f' 
  AND (
    token = 'CgBvZC/QZr9/yz4MXbjQfYZ+T8r0AKOcJvP/VEAHB1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032