UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ur2jzk8AvKq5K9ZfEGd10jlxZbymywlrXxv0Yq1Sp0g='
WHERE
key_id = '668b523a9070c662cf8075c235c6829c561eadc70f57e853b328ce31c0281f19'
AND (
token = 'Ur2jzk8AvKq5K9ZfEGd10jlxZbymywlrXxv0Yq1Sp0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)