UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iHwoT9nKeMtAr/OYEAGtdv9i3h5Nv/iNjz6yan0t7Pg='
WHERE
key_id = '1740708e89c82e3519f6745d59ff2a2c0b07dcf7a75611eedbbc411934db5f09'
AND (
token = 'iHwoT9nKeMtAr/OYEAGtdv9i3h5Nv/iNjz6yan0t7Pg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)