UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JcoG796szaxafaocwfPigkUKChExP2/gAvGps0pMpl0='
WHERE
key_id = '06af3676299c3bb0c5a40250f01477fbc8faf3c0c1baa687f30337a09fef888d'
AND (
token = 'JcoG796szaxafaocwfPigkUKChExP2/gAvGps0pMpl0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)