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