UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PfFRcjbCbYQv0zb2p5vJobFhTA8OL2vJUBpjfMThB4g='
WHERE
key_id = '2fda1c8772583d93a75517c1a20388ba513b0cbf18ef1c5af295a7576c0f3b44'
AND (
token = 'PfFRcjbCbYQv0zb2p5vJobFhTA8OL2vJUBpjfMThB4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)