UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CtIdpON6+ZOACYkJVlgt/MFLX/R/Qt0Fr3PXchok85w='
WHERE
key_id = 'efac86dca7ea3ab9ac0b57b553277a23d045f0315b85cba76c024d36aa6f4555'
AND (
token = 'CtIdpON6+ZOACYkJVlgt/MFLX/R/Qt0Fr3PXchok85w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)