UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kmckTgGQOo/38UA54o35ttKfoZ7IyGiFRK4gBc9fnUY='
WHERE
key_id = 'b99e983ced7f38264d8da3f80ef3bef75c2082ff4fa570c84b34d09651ddb425'
AND (
token = 'kmckTgGQOo/38UA54o35ttKfoZ7IyGiFRK4gBc9fnUY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)