UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7MoDcv7SrmfbAte2lFGkymjj6YbB2Jt/T26ykM5la9Y='
WHERE
key_id = 'a12e536d0ec7b580415f7ad74407ff0c5c9b6626c256e800bc04c11fb15e6836'
AND (
token = '7MoDcv7SrmfbAte2lFGkymjj6YbB2Jt/T26ykM5la9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)