UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pmxgzsCnO72ZHa+BI6GG5HHe5ix6cHqw1LHgFtUssMM='
WHERE
key_id = '1c7f5d10b743c23935cc9ce41a7c6867aa65fdc9f10b1de578bcbdc52f9c9b64'
AND (
token = 'pmxgzsCnO72ZHa+BI6GG5HHe5ix6cHqw1LHgFtUssMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)