UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5nkk0zDF28hEWPh1W+28h/9nVzr3MJIxeQRf1ZDEXMc='
WHERE
key_id = '34bacbbd7d5a75ddfcb2a2cd85b7907b3d0259ac3be1cee7f9bcbb295b0217f0'
AND (
token = '5nkk0zDF28hEWPh1W+28h/9nVzr3MJIxeQRf1ZDEXMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)