UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VCB0U+refly5UuUa04lh5c5us4yvPqxR4u6k6VyBHtI='
WHERE
key_id = 'ddc6cfcc59b4d11e4d34cd45bdba914ad0d6ce526a663e4d03a1be1df0fe7323'
AND (
token = 'VCB0U+refly5UuUa04lh5c5us4yvPqxR4u6k6VyBHtI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)