UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zObWQSHvZR7XI5jSBpzg2Fq1X75+nwlVhbfCVLgi0xQ='
WHERE
key_id = '3fd9744561563c9e81164fe896c3ff01a263c0d7e07202ca8912953b899d5f69'
AND (
token = 'zObWQSHvZR7XI5jSBpzg2Fq1X75+nwlVhbfCVLgi0xQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)