UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8K8JMqtNJRftX7RXwW0EnfZhNK1PemFHf7f4LKLJMFM='
WHERE
key_id = '3468c5f3a2b9a49ec00b42643f65bd45c5672bb3b02e0504658211b04e2a8074'
AND (
token = '8K8JMqtNJRftX7RXwW0EnfZhNK1PemFHf7f4LKLJMFM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)