UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aQl7hOvnG32KPX3vk2GkPbMP6b5/MXlDDAJD+VwO4Bw='
WHERE
key_id = '3499919002b603fdb2f5a2d330737f5f765b3a15eafd2f102c17a395198d6daa'
AND (
token = 'aQl7hOvnG32KPX3vk2GkPbMP6b5/MXlDDAJD+VwO4Bw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)