UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6HPbz3TDNluyy2cs3RUzn2fKd/0Bu3vJl/Sixyr0mtc='
WHERE
key_id = '469b55f01c90ba015c3b7834fee38cc160433b4b2eb7c2df899e572b471a26ff'
AND (
token = '6HPbz3TDNluyy2cs3RUzn2fKd/0Bu3vJl/Sixyr0mtc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)