UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bOlZTWfTZIKLZEQLTadTQg9cmYOGtaiaT1zS0Tvk020='
WHERE
key_id = '0f99b296b3c16b35b1ad9a207eb116cfa3a28482479b852842eb61ccb22826f7'
AND (
token = 'bOlZTWfTZIKLZEQLTadTQg9cmYOGtaiaT1zS0Tvk020='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)