UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3rTyES9NJkQ3/KE7LeKI1T1IrLBtkgBxTYrumItTczE=' 
WHERE 
  key_id = '95487ac0554b6835ba1bb2f214d2683bd8563d4ab15414fb80a43ab071cc4a8c' 
  AND (
    token = '3rTyES9NJkQ3/KE7LeKI1T1IrLBtkgBxTYrumItTczE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025