UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U6v7ir13Rzxumieh+uFCXwt89n6EhC+WpcJZMtIudBc='
WHERE
key_id = '25f040771d4983feba2e95b3af5cfb5f56a142e59423ff2bced85f46a195d81b'
AND (
token = 'U6v7ir13Rzxumieh+uFCXwt89n6EhC+WpcJZMtIudBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)