UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N7EVx0/Auo2xsIaIYdtTE+dZidd/ZVJagP9g79/5wXs='
WHERE
key_id = '2d492aaeda2f60ec1d0fd95355c12564b4295a854912fecf6702ec6a23a8a131'
AND (
token = 'N7EVx0/Auo2xsIaIYdtTE+dZidd/ZVJagP9g79/5wXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)