UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xU1GFHnqry+q4Mtd9uyc2lIYLt7k9p+IVdqZ/2eJxL0='
WHERE
key_id = '6762c01c19ff8bfe8b9fb4484000f56aeb6a8caf4c26e0ec16c064ab801ff5c6'
AND (
token = 'xU1GFHnqry+q4Mtd9uyc2lIYLt7k9p+IVdqZ/2eJxL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)