UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qg8WAMGH/Y8rV0tYTg+x3pXZ80J9FBD/uepwT42o4Ck='
WHERE
key_id = 'a4eb63a5a58d7458d42a3b31704439fb8a2b7aa66668d924922b789a1f08b2ac'
AND (
token = 'Qg8WAMGH/Y8rV0tYTg+x3pXZ80J9FBD/uepwT42o4Ck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)