UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0KVpodTA+nLQAf8DGrLMUtcht1t7sOs+Jy8ZXIvI+Jc='
WHERE
key_id = 'eec81926b27a01b2aedc7117ccb69b404ad20e35d02e633900314a109e1ebfe5'
AND (
token = '0KVpodTA+nLQAf8DGrLMUtcht1t7sOs+Jy8ZXIvI+Jc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)