UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cwt91KvLPqnIng1AdF+GNN/LzxJp6pTn90HUMW1aFsk='
WHERE
key_id = '15bdb1c8e49307d9dfe092cfd4e0dae2c261ea4638f34f622404d27188da5475'
AND (
token = 'cwt91KvLPqnIng1AdF+GNN/LzxJp6pTn90HUMW1aFsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)