UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1/BxSIZDII8dGe++cuIAIhc7OGFOzqL729tM9OsnxU4='
WHERE
key_id = '4ac8986a4e9e4534617b0fbfdd8928cce4dcfaf5729be57f8a5ebba4fa89ab8e'
AND (
token = '1/BxSIZDII8dGe++cuIAIhc7OGFOzqL729tM9OsnxU4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)