UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Av4ae3FcwJxslOJlO6Zp610A1Q+GU2UszHu9SFs5gD4='
WHERE
key_id = '068117efdf7e68423bbd73d1a648e3970fcb8dffc565517e1cf1a15ac93904b9'
AND (
token = 'Av4ae3FcwJxslOJlO6Zp610A1Q+GU2UszHu9SFs5gD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)