UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5dVCjTpFriYuIqc64MHTvtSHhVXSW1bEEFiWGmfOPzM='
WHERE
key_id = '6c92889b4032ca3a8fb94c9a2dee8b71ef0d0a4d7112070cc2f89dd0c2311b25'
AND (
token = '5dVCjTpFriYuIqc64MHTvtSHhVXSW1bEEFiWGmfOPzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)