UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qu+0uM+DX3wtIYsixNfIJqgVm1ugU1Sj820v2OQ71gI='
WHERE
key_id = '33be62f5a398a74f3665607646f4e912e8f2e0236144d0ebd2363f49a0176e3c'
AND (
token = 'Qu+0uM+DX3wtIYsixNfIJqgVm1ugU1Sj820v2OQ71gI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)