UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CrgS9iJSjoKKuxOwSqYBzrb8gnj1LqhSmIPs7xyGS7U=' 
WHERE 
  key_id = '94f6f55f268496c3c8fd7a36fa1c30dd32d73f55ccc8a4bf6fdae8a4e06c474b' 
  AND (
    token = 'CrgS9iJSjoKKuxOwSqYBzrb8gnj1LqhSmIPs7xyGS7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028