UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1BlsFq804yIgQb0GgL50aaBbbj2KhLe+XU6rzgXRWKc=' 
WHERE 
  key_id = '360363743eeb9781dc3a08e1eab343587370b1aa8804f00a0c3beb9d22ad1bfe' 
  AND (
    token = '1BlsFq804yIgQb0GgL50aaBbbj2KhLe+XU6rzgXRWKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00076