UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w+73dxFazrwrWDvgr0yih65cScAmsbPO8RQL737UJYE='
WHERE
key_id = 'e7428b878e1dd699f0a4d956a7cdcb53f9a76fc55be7f67d56f4d5213976c745'
AND (
token = 'w+73dxFazrwrWDvgr0yih65cScAmsbPO8RQL737UJYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)