UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K9rvO/eeItz/kOl+c/kvUtjYjn30p8BO1klny/87ocE='
WHERE
key_id = '543523330e4da149700a0a89a64517d4e2f000381a6eb9815fefe300a348d18c'
AND (
token = 'K9rvO/eeItz/kOl+c/kvUtjYjn30p8BO1klny/87ocE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)