UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CUJq14/dxQ0hD3xpIxh3RdivDJJEv1Vg4oET9rfihHk='
WHERE
key_id = '0ed7d6f9bfbbd338694c36ba06a480c22626e613cb67b7496042cd0238be3a62'
AND (
token = 'CUJq14/dxQ0hD3xpIxh3RdivDJJEv1Vg4oET9rfihHk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)